// 6_4.c Returnning a Value
#include <stdio.h>
int main()
{
    float findMax(float, float); /*the function prototype*/
    float firstnum, secnum, max;

    printf("Enter a number: ");
    scanf("%f", &firstnum);
    printf("Great! Please enter a second number: ");
    scanf("%f", &secnum);

    max = findMax(firstnum, secnum); /*the function is called here*/

    printf("\nThe maximum of the two numbers is %f\n", max);

    return 0;
}

/*the following is the function findMax*/
float findMax(float x, float y) /*this is the function's header line*/
{
    float maxnum;

    if (x >= y) /*find the maximum number*/
        maxnum = x;
    else
        maxnum = y;

    return maxnum;
}
